#!/bin/bash
#sleep 120
script=$(realpath $0)
sp=$(dirname $script )
for i in /dev/ttyACM*; do
  if [ $(udevadm info -a -q property --export -n $i|grep GNSS|wc -l) -gt 1 ]; then
    TTY=$(echo $i|cut -d/ -f3)
    uid=$(echo $(udevadm info --name=${i}|sed -n '/MAJOR/{s/[A-Z: =]*//;p}')*256+$(udevadm info --name=/dev/${TTY}|sed -n '/MINOR/{s/[A-Z: =]*//;p}')|bc)
   idp=$(udevadm info -a -q property --export -n $i|grep ID_MODEL_ID|cut -d= -f2|sed -e "s/'//g")
   idv=$(udevadm info -a -q property --export -n $i|grep ID_VENDOR_ID|cut -d= -f2|sed -e "s/'//g")
   idpath=$(udevadm info -a -q property --export -n $i|grep ID_PATH=|cut -d= -f2|sed -e "s/'//g")
   nohup ${sp}/gps_raw5.sh ${TTY} &>/dev/null &
  fi
done

